using System;
using System.Linq;
using System.Text;
using Windows.UI;
using Windows.UI.Xaml.Media;

namespace Demo02
{
    public class DocumentModel
    {
        public string Title { get; set; }
        public string Content { get; set; }
        public SolidColorBrush Brush { get; set; }

        private static Random _Random = new Random((int)DateTime.Now.Ticks);
        public static DocumentModel Factory(int i = 0)
        {
            var c = new StringBuilder();
            foreach (var p in Enumerable.Range(1, _Random.Next(3, 10)))
            {
                foreach (var s in Enumerable.Range(1, _Random.Next(1, 3)))
                    c.Append("Four score and seven years ago our fathers brought forth upon this contitnent a new nation conceived in liberty and dedicated to the proposition that all men are created equal.");
                c.AppendLine();
                c.AppendLine();
            }
            var content = c.ToString();
            var title = string.Empty;
            switch (_Random.Next(1, 3))
            {
                case 1:
                    title = string.Format("{0} The quick brown fox jumps over the lazy dog.", i);
                    break;
                case 2:
                    title = string.Format("{0} Now is the time for all good men to come to the aif their party.", i);
                    break;
                case 3:
                    title = string.Format("{0} How much wood could a wood chuck chuck if a wood chuck could chuck wood?.", i);
                    break;
            }
            return new DocumentModel
            {
                Title = title,
                Content = content,
                Brush = (i % 2 == 0) ? new SolidColorBrush(Colors.Black) { Opacity = .25 } : new SolidColorBrush(Colors.Transparent)
            };
        }
    }
}